package com.hb.guli.service.base.exception;

import com.hb.guli.common.base.result.ResultCodeEnum;
import lombok.Data;

@Data
public class GuliException extends RuntimeException{

    private int errorCode;

    public GuliException(String message, Integer code) {
        super(message);
        this.errorCode = code;
    }

    public GuliException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.errorCode = resultCodeEnum.getCode();
    }

   @Override
   public String toString(){
        return "GuliException{" +
                "code:" + errorCode +
                "，message:" + this.getMessage() + "}";
    }
}
